package base.exec;

public class Excmd {

	public static Process shutdown(long second) throws Exception {
		Runtime runtime = Runtime.getRuntime();
		String cmd = "shutdown -s -t " + second;
		Process process = runtime.exec(cmd);
		return process;
	}

	public static Process shutdown() throws Exception {
		return shutdown(0);
	}

	public static void cancel() throws Exception {
		Runtime runtime = Runtime.getRuntime();
		String cmd = "shutdown -a ";
		runtime.exec(cmd);
	}
	public static void openExplorer() throws Exception{
		Runtime runtime = Runtime.getRuntime();
		String cmd = " /home/yaoming/workspace";
		runtime.exec(cmd);
	}
	public static void main(String[] args) throws Exception {
		System.out.println(System.getProperty("os.name"));
		System.out.println(System.getProperty("user.name"));
		System.out.println(System.getProperty("os.arch"));
//		openExplorer();
	}
}
